﻿@model IEnumerable<Project.Domain.Entities.Contact>
@using QuocViet.WebUI.Helpers   
@{
	ViewBag.Title = "allUser";
}

<div class="content_table">
	<table width="100%"  cellspacing="0" cellpadding="0" border="0">
		<tr>
			<th class="th_no_cursor" width="40">No.</th>
			<th class="th_no_cursor" width="31">
				<input type="checkbox" class="custom_chk" id="selectAllItems" onclick="selectAllItems(@ViewBag.result)" />
			</th>
			<th class="th_left" onclick="sort('title')">
				<div id="title" class="sort icon_no_sort">Body</div>
			</th>			
			<th width="70" onclick="sort('status')"><div id="status" class="sort icon_no_sort">Status</div></th>
			<th class="th_last" width="100" onclick="sort('created')"><div id="created" class="sort icon_sort_asc">Created</div></th>
		</tr>
		@{
			if (Convert.ToInt32(ViewBag.result)>0)
			{
				var i = 0;
				var count = 0;
				foreach (var contact in Model)
				{
					count = count + 1;    
					var classCss="item_row" + i;
                    var loadStatusID = "loadStatusID_" + contact.ContactId;
					<tr class="@classCss @(i%2 == 0 ? Html.Raw("row1") : Html.Raw("row2"))">					
						<td class="td_center">@count</td>
						<td class="td_no_padd">
							<input type="checkbox" class="custom_chk" id="item+@i" onclick=" selectItem(@i) " value="@contact.ContactId" />
						</td>                        
                        <td class="th_left">
							<a href="@Url.Action("UpdateUser", "ManageUsers", new { userId = contact.ContactId })">@contact.Body</a>
						</td>
						<td class="td_center" id="@loadStatusID">
							<a href="javascript:void(0)" onclick="  updateStatus(@contact.ContactId,@Convert.ToInt32(contact.Active),'managecontent')">
								@if (contact.Active)
								{
									<img alt="Checked item" src="@Url.Content("~/Areas/Content/images/admin/icons/check_16x16.png")" />
								}
								else
								{
									<img alt="Checked item" src="@Url.Content("~/Areas/Content/images/admin/icons/uncheck_16x16.png")"/>
								}
																							  
							</a>
						</td>

						<td class="th_last td_center">
							@string.Format("{0:dd-MM-yyyy}", contact.CreatedTime)
						</td>
					</tr>
				}
				i += 1;
				count += 1;
			}
			else
			{
				<tr class="row1">
					<td class="th_last td_center" colspan="50" style="font-size: 20px; padding: 50px 0">No data</td>
				</tr>
			}
		}
	</table>
</div>
@*<div id="phantrang_clip" style="padding-top: 0px;">
	<div style="float:right;">
		@Html.Raw((Html.Pager((MvcContrib.Pagination.IPagination)Model).Format("").SingleFormat("").First("Đầu").Last("Cuối").Next("").Previous("")).ToString())    
	</div>
	<div class="ClearAll"></div>
</div>*@

@*<div class="pagination">
	<div style="float:right;">
		@Html.Raw((Html.Pager((MvcContrib.Pagination.IPagination)Model).Format("").SingleFormat("").First("Đầu").Last("Cuối").Next("").Previous("")).ToString())    
	</div>
</div>*@
@*
<?php if($result){ ?>
<div class="footer_table">
	<div class="item_per_page">Items per page:</div>
	<div class="select_per_page">
		<select id="per_page" onchange="searchContent(<?=$start?>,this.value)">
			<option <?php ($per_page==10) ? print 'selected="selected"' : print '' ?> value="10">10</option>
			<option <?php ($per_page==25) ? print 'selected="selected"' : print '' ?> value="25">25</option>
			<option <?php ($per_page==50) ? print 'selected="selected"' : print '' ?> value="50">50</option>
			<option <?php ($per_page==100) ? print 'selected="selected"' : print '' ?> value="100">100</option>
		</select>
	</div>
	
	<div class="pagination"><?=$this->adminpagination->create_links();?></div>
</div>
<div class="clearAll"></div>
<?php } ?>
}*@



@*
<div id="menucontainer">
	<ul id="menu" style=" text-align:left;">
		<li>@Html.ActionLink("List Users", "Allusers", "manageusers")</li>
		<li>@Html.ActionLink("List Deposit", "listalldeposit", "manageusers")</li>
		<li>@Html.ActionLink("List Withdraw", "Listallwithdraw", "manageusers")</li>
	</ul>
</div>
<h2>Danh sách Users</h2>
<table>
	<tr>
		<th>UserName</th>
		<th>Email</th>
		<th>LR</th>
		<th>Amount</th>
		<th>Created</th>
		<th>Status</th>
		<th>Action</th>
	</tr>
	@foreach (var user in Model)
 {
		<tr>
			<td>
				@user.UserName
			</td>
			<td>
				@user.Email
			</td>
			<td>
				@user.LrAccount
			</td>
			<td>
				@Html.Slip(user.Balance.ToString())
			</td>
			<td>
				@string.Format("{0:dd/MM/yyy}", user.CreatedTime)
			</td>
			<td>
				@user.Active
			</td>
			<td>
				@Html.ActionLink("Edit", "Edituser", new { controller = "ManageUsers", userid = user.UserId })
			</td>
		</tr>                
 }
	<tr>
		<td>
		</td>
	</tr>

</table>

<div id="phantrang_clip" style="padding-top: 0px;">
	<div style="float:right;">
		@Html.Raw((Html.Pager((MvcContrib.Pagination.IPagination)Model).Format("").SingleFormat("").First("Đầu").Last("Cuối").Next("").Previous("")).ToString())    
	</div>
	<div class="ClearAll"></div>
</div>*@
